# -*- coding: utf-8 -*- 
# 作者:飞虎
# 开发时间:2022/5/13 21:06
from PyQt5.Qt import *


class Window(QWidget):
	def __init__(self):
		super().__init__()
		self.setWindowTitle('QInputDialog学习')
		self.resize(500, 500)
		self.setup_ui()

	def setup_ui(self):
		# result=QInputDialog.getInt(self,"xx1","xxx2",888,step=8)
		# result=QInputDialog.getDouble(self,"xx1","xxx2",88.88,decimals=2)
		# result=QInputDialog.getText(self,"xx1","xxx2",echo=QLineEdit.Password)
		# result=QInputDialog.getMultiLineText(self,"xx1","xxx2",'default')
		# result=QInputDialog.getItem(self,"xx1","xxx2",['1','2','3'],2,True)
		# print(result)

		input_d=QInputDialog(self,Qt.FramelessWindowHint)
		# input_d.setOption(QInputDialog.UseListViewForComboBoxItems)
		# input_d.setComboBoxItems(['1','2','abc'])

		# input_d.setLabelText('请输入您的姓名:')
		# input_d.setOkButtonText('好的')
		# input_d.setCancelButtonText('我想取消')

		input_d.setInputMode(QInputDialog.DoubleInput)
		# input_d.setDoubleRange(9.9,19.9)
		# input_d.setDoubleStep(2)
		# input_d.setDoubleDecimals(3)

		# input_d.intValueChanged.connect(lambda val:print("整型数据发生改变",val))
		# input_d.intValueSelected.connect(lambda val:print("整型数据选中时",val))

		input_d.doubleValueChanged.connect(lambda val: print("整型数据发生改变", val))
		input_d.doubleValueSelected.connect(lambda val: print("整型数据选中时", val))

		input_d.show()


if __name__ == '__main__':
	import sys

	app = QApplication(sys.argv)
	window = Window()
	window.show()
	sys.exit(app.exec_())